package br.inf.solutions.apresentacoes.ssp.model.bulletin;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import br.com.vexillum.model.CommonEntityActivated;
import br.com.vexillum.model.annotations.SearchField;
import br.com.vexillum.model.annotations.ValidatorClass;

@SuppressWarnings("serial")
@ValidatorClass(validatorClass="br.inf.solutions.apresentacoes.ssp.control.validator.BulletinPublishedItensValidator")
@Entity
@Table(name="bulletin_published_itens")
public class BulletinPublishedItem extends CommonEntityActivated {

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_bulletin", nullable = true, updatable = false, unique = false)
	private Bulletin bulletin;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_item", nullable = false, updatable = false, unique = true)
	private BulletinItem item;
	
	@SearchField
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_topic", nullable = false, updatable = false, unique = false)
	private BulletinTopics topic;

	public BulletinItem getItem() {
		return item;
	}

	public void setItem(BulletinItem item) {
		this.item = item;
	}

	public BulletinTopics getTopic() {
		return topic;
	}

	public void setTopic(BulletinTopics topic) {
		this.topic = topic;
	}

	public Bulletin getBulletin() {
		return bulletin;
	}

	public void setBulletin(Bulletin bulletin) {
		this.bulletin = bulletin;
	}
	
}
